<?php
session_start();
//USED TO TIMEOUT USERS AFTER INACTIVITY.. CHANGE $sessiontime VARIABLE IN HERE AND IN CONFIRMLOGIN.PHP
if(!isset ($_SESSION['volunteerID']))
{
	$_SESSION['auth'] = false;
}
else
{
	$sessiontime=30;
	$c_hour = date("H");    //Current Hour
	$c_min = date("i");    //Current Minute
	$c_sec = date("s");    //Current Second
	$c_mon = date("m");    //Current Month
	$c_day = date("d");    //Current Day
	$c_year = date("Y");    //Current Year 

	$currentTime = mktime($c_hour,$c_min,$c_sec,$c_mon,$c_day,$c_year);
	$originalTime = $_SESSION['stamp'];
	
	if($originalTime > $currentTime)
	{
		$c_timestamp = mktime($c_hour,$c_min+$sessiontime,$c_sec,$c_mon,$c_day,$c_year);
		$_SESSION["stamp"] = $c_timestamp;
	}
	else
	{
		header("Location: logout.php");
	}
}
?>
